package com.sjy.shopmall.utils;

import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@Component
public class SysUtils {
    @Resource
    HttpServletRequest request;

    public Long getLoginedUserID() {
        try {
            return Long.parseLong(request.getHeader("X-Token"));
        } catch (Exception e) {
            return null;
        }
    }

}
